clear all
set more off
set seed 6615230

*******************************************************************
//// 10-BUILD_STOPSFHP: CONSTRUCT MASTER DATASET OF FHP STOPS ////
*******************************************************************


use "${temp}/process-citation", clear


**********************************************
//// IDENTIFY IN-STATE + VALID FLORIDA DL ////
**********************************************

gen dlstate=trim(upper(DLstate))
gen instate=(dlstate=="FL")

gen dlnumber=trim(upper(DLnumber))

gen firstchar=substr(dlnumber,1,1)
gen firstalpha=regexm(firstchar,"^[A-Z]")

gen restchar=substr(dlnumber,2,.)
gen restalpha=regexm(restchar,"^[A-Z]")

gen dlvalid = (dlstate=="FL") & (length(dlnumber)==13) & (firstalpha==1) & (restalpha==0)

label var dlstate "DL State"
label var instate "DL State = FL"
label var dlvalid "Valid Florida DL"



************************************************************
//// ASIDE BEFORE CUTTING THE DATA: SIMULTANEOUS STOPS? ////
************************************************************

replace OffenseHour = OffenseHour+12 if !mi(OffenseTimeAM) & (OffenseTimeAM==0)
bysort dlstate dlnumber OffenseDate OffenseHour: egen hourstops = sum(1)
gen otherstop = hourstops>1
replace otherstop = . if mi(dlstate)|mi(dlnumber)|mi(OffenseDate)|mi(OffenseHour)
replace otherstop = 0 if mi(otherstop)
drop hourstops



***************************************
//// CUT TO FHP ISSUED TICKETS     ////
//// PREP FOR FUTURE SPEEDING CUTS ////
***************************************

* SPEEDING ISSUED BY FHP *
keep if IssueAgencyType==1

* ATTACH OFFICER MATCHING *
merge 1:1 CitationNumber CountyNum using "${temp}/step-1-officer", keep(1 3) nogen
ren person_nbr officerid

* SPEEDING SAMPLE *
#delimit ;
gen speedsample = (Viol_Code==575)
& !mi(PostedSpeed)  & !mi(SpeedDiff) 
& (PostedSpeed>=25) & (PostedSpeed<=70)
& (SpeedDiff>=6)    & (SpeedDiff<=29) ;
#delimit cr

* CODE FINES (SPEEDING ONLY) *
gen fine = 0
replace fine = 25 if SpeedDiff>=6 & SpeedDiff<=9
replace fine = 100 if SpeedDiff>=10 & SpeedDiff<=14
replace fine = 150 if SpeedDiff>=15 & SpeedDiff<=19
replace fine = 175 if SpeedDiff>=20 & SpeedDiff<=29
* TRUE FINE ADDS 98 (DISTRIBUTION) *
replace fine = fine + 98
replace fine = . if speedsample==0

* CODE POINTS *
gen points = 3
replace points = 4 if SpeedDiff>=16
replace points = . if speedsample==0



***************************************
//// COMPANION EVENTS + VIOLATIONS ////
***************************************

* CITATION WITH CRASH OR BREATHALIZER *
egen crash = rowmax(Crash PropertyDamage Injury SeriousInjury FatalInjury BAL08)
label var crash "Any Crash" 

* OTHER VIOLATION MEASURE 1: DIRECTLY RECORDED IN UTC *
gen companion1 = (CompanionCitation==1|Viol_Other==1)
replace companion1 = 0 if mi(companion1)
label var companion1 "Companion 1: Recorded in UTC"

* OTHER VIOLATION MEASURE: SIMULTANEOUS UTC VIOLATION *
* COMPUTED ABOVE BEFORE CUTTING DOWN TO FHP *
gen companion2 = otherstop
label var companion2 "Companion 2: Other Stop in Same Hour"

* OTHER VIOLATION MEASURE 3: USES COURTS DATA *
gen citationnumber = CitationNumber
gen countynum = CountyNum
qui compress
saveold "${temp}/TEMP", replace

keep citationnumber countynum Viol_Code
merge 1:m citationnumber countynum using "${temp}/process-court", keep(3) nogen
gen companion3 = !mi(Viol_Code) & !mi(viol_code) & (Viol_Code != viol_code)
collapse (max) companion3, by(citationnumber countynum)
qui compress
saveold "${temp}/TEMP-COMPANION", replace

use "${temp}/TEMP", clear
merge 1:1 citationnumber countynum using "${temp}/TEMP-COMPANION", keep(1 3) nogen

replace companion3 = 0 if mi(companion3)
label var companion3 "Companion 3: Other Violation in Courts Data"


// TOTAL OF ALL 3 //
egen companion = rowmax(crash companion1 companion2 companion3)
label var companion "Any Companion Violation or Crash" 



**************************
//// STOP INFORMATION ////
**************************

* HOURS *
gen Hour = OffenseHour 
gen AMPM = OffenseTimeAM
replace Hour = Hour + 12 if Hour<12 & AM == 0

* ADJUST DATE FOR SHIFTS *
gen offensedate = OffenseDate
gen offensedateadj = offensedate
replace offensedateadj = offensedateadj - 1 if Hour<=5 & !mi(Hour)

* COMPUTE SHIFTS *
gen Shift = 1 if Hour>=6 & Hour<14 & !mi(Hour)
replace Shift = 2 if Hour>=14 & Hour<22 & !mi(Hour)
replace Shift = 3 if (Hour>=22 | Hour <6) & !mi(Hour)

* MISSING SHIFT FLAG *
gen ShiftMiss = mi(Hour)

* IMPUTE SHIFT *
count if !mi(Hour)
local DENOM = r(N)
count if Shift==1 & !mi(Shift)
local CUT1 = r(N)/`DENOM'
count if Shift==2 & !mi(Shift)
local CUT2 = r(N)/`DENOM' + `CUT1'

gen RANDOM = runiform()
replace Shift = 1 if mi(Shift) & RANDOM<`CUT1'
replace Shift = 2 if mi(Shift) & RANDOM>=`CUT1' & RANDOM<`CUT2'
replace Shift = 3 if mi(Shift) & RANDOM>=`CUT2'

* READJUST DATES *
replace offensedateadj = offensedateadj - 1 if Shift==1 & ShiftMiss==1
gen dow = dow(offensedateadj)
gen wknd = (dow==0|dow==6)

* TROOP BASED ON COUNTY *
merge m:1 CountyNum using "${raw}/geo/CountyTroopDistrict", keep(1 3) nogen
drop CountyName
ren Troop troop
ren District district

* RENAME VARS *
ren Shift shift
ren Hour hour
ren ShiftMiss shift_miss




****************************
//// DRIVER INFORMATION ////
****************************

merge 1:1 CitationNumber CountyNum using "${temp}/step-2-driver", keep(1 3) nogen

gen dob = BirthDate
gen female = Female
gen raceorig = Race
ren CensusHisp censushisp
gen race = raceorig
replace race = "H" if censushisp==1
replace race = "O" if race=="A"|race=="I"
replace race = "U" if race!="B"&race!="H"&race!="O"&race!="W"

gen race_b = (race=="B")
gen race_h = (race=="H")
gen race_o = (race=="O")
gen race_u = (race=="U")

ren Zip zip
ren ZipIncome zipincome
gen logzipincome = log(zipincome)
ren ZipIncomeMiss zipincome_miss
ren ZipFlorida zipflorida

gen age = year(OffenseDate)-year(BirthDate)
gen age_miss = mi(age)|(age<16)|(age>90)
replace age = 16 if !mi(age) & age<16
replace age = 90 if !mi(age) & age>90
summ age
replace age = r(mean) if mi(age)
gen agesq = age^2

ren HomeFips homecountyfips
ren HomeCountyNum homecountynum
ren PriorPrison priorprison

gen local = (homecountynum == countynum)
replace local = 0 if mi(local) 



*****************************
//// VEHICLE INFORMATION ////
*****************************

merge 1:1 CitationNumber CountyNum using "${temp}/step-3-vehicle", keep(1 3)
gen veh_miss = (_m==1)
drop _m

replace veh_make = "MISS" if mi(veh_make)
summ veh_age
replace veh_age = round(r(mean)) if mi(veh_age)
summ veh_price
replace veh_price = r(mean) if mi(veh_price)
gen logprice = log(veh_price)

replace VehicleState = trim(upper(VehicleState))
gen veh_florida = (VehicleState=="FL")



*************************
//// GPS INFORMATION ////
*************************

merge 1:1 CitationNumber CountyNum using "${temp}/step-4-gps", keep(1 3)
gen hasgps = (_m==3)
drop _m
ren road_id roadid
ren gpslong gpslon



*******************************
//// COMPILE STOPS DATASET ////
*******************************

ren ArrestMethod arrestmethod
ren Viol_Code viol_code
ren PostedSpeed postedspeed
ren ActualSpeed actualspeed
ren SpeedDiff speeddiff
gen year  = year(offensedateadj)
gen month = month(offensedateadj)
gen highway = !mi(postedspeed) & postedspeed >= 55

#delimit ;
keep 
citationnumber countynum offensedate offensedateadj year month dow wknd hour shift shift_miss
viol_code postedspeed actualspeed speeddiff highway crash companion1 companion2 companion3 companion
speedsample fine points arrestmethod officerid troop district
dlstate dlnumber instate dlvalid 
dob female age agesq age_miss raceorig censushisp race race_b-race_u priorprison
zip zipincome logzipincome zipincome_miss zipflorida
zipflorida homecountyfips homecountynum local
veh_make veh_year veh_age veh_price logprice veh_miss veh_florida
hasgps gpslat gpslon roadid roadway rtlength ;

order
citationnumber countynum offensedate offensedateadj year month dow wknd hour shift shift_miss
viol_code postedspeed actualspeed speeddiff highway crash companion1 companion2 companion3 companion
speedsample fine points arrestmethod officerid troop district
dlstate dlnumber instate dlvalid 
dob female age agesq age_miss raceorig censushisp race race_b-race_u priorprison
zip zipincome logzipincome zipincome_miss 
zipflorida homecountyfips homecountynum local 
veh_make veh_year veh_age veh_price logprice veh_miss veh_florida
hasgps gpslat gpslon roadid roadway rtlength ;
#delimit cr


label var citationnumber "Citation Number"
label var countynum "County"
label var offensedate "Date"
label var offensedateadj "Date (Shift Adjusted)"
label var year "Year"
label var month "Month"
label var dow "Day of Week"
label var wknd "Weekend"
label var hour "Hour"
label var shift "Shift"
label var shift_miss "Shift Missing"
label var viol_code "Violation Code"
label var postedspeed "Posted Speed"
label var actualspeed "Actual Speed"
label var speeddiff "MPH Over Posted"
label var highway "Highway (55MPH+)"
label var speedsample "Speeding Sample"
label var fine "Fine Amount"
label var points "DL Points"
label var arrestmethod "Arrest Method"
label var officerid "Officer ID"
label var troop "Troop (from County)"
label var district "District (from County)"
label var dlstate "DL State"
label var dlnumber "DL Number"
label var instate "DL State = Florida"
label var dlvalid "Valid Forida DL"
label var dob "Date of Birth"
label var female "Female"
label var age "Age"
label var agesq "Age Squared"
label var age_miss "Age Missing"
label var raceorig "Race Original"
label var censushisp "Hispanic Surname"
label var race "Race"
label var race_b "Race = Black"
label var race_h "Race = Hispanic"
label var race_o "Race = Other"
label var race_u "Race = Unknown" 
label var priorprison "Prior Prison Spell"
label var zip "Zip Code"
label var zipincome "Zip Income"
label var logzipincome "Log Zip Income"
label var zipincome_miss "Zip Income Missing"
label var zipflorida "Zip State = Florida"
label var homecountyfips "Home County (FIPS)"
label var homecountynum "Home County"
label var local "County Resident"
label var logprice "Log Vehicle Price"
label var veh_miss "Vehicle Info Missing"
label var veh_florida "Vehicle Tag = Florida"
label var hasgps "Has GPS Info"
label var gpslat "Lattitude"
label var gpslon "Longitude"
label var roadid "Road ID"
label var roadway "Roadway"
label var rtlength "Segment Length"

qui compress
saveold "${temp}/TEMP", replace





*************************
//// ADD COURTS DATA ////
*************************

use "${temp}/process-court", clear
gen numberdisp = 1
collapse (sum) numberdisp, by(citationnumber countynum)
qui compress
saveold "${temp}/TEMP-COURT-1", replace

use "${temp}/process-court", clear
bysort citationnumber countynum (disp_date disp_order): gen order = _n
keep if order == 1
keep citationnumber countynum verdict 
ren verdict verdict_1 
qui compress
saveold "${temp}/TEMP-COURT-2", replace


use "${temp}/process-court", clear
bysort citationnumber countynum (disp_date disp_order): gen order = _n
bysort citationnumber countynum: egen maxorder = max(order)
keep if order == maxorder
keep citationnumber countynum verdict 
ren verdict verdict_final
qui compress
saveold "${temp}/TEMP-COURT-3", replace


use "${temp}/TEMP", clear
merge 1:1 citationnumber countynum using "${temp}/TEMP-COURT-1", keep(1 3) nogen
replace numberdisp = 0 if mi(numberdisp)
merge 1:1 citationnumber countynum using "${temp}/TEMP-COURT-2", keep(1 3) nogen
merge 1:1 citationnumber countynum using "${temp}/TEMP-COURT-3", keep(1 3) nogen


label var numberdisp "Number Dispositions (TCATS)"
label var verdict_1 "First Disposition Code"
label var verdict_final "Last Disposition Code"


/// CLEAN UP COURTS STUFF ////
gen tverdict_1 = verdict_1 
replace tverdict_1 = "" if verdict_1!="1"&verdict_1!="3"&verdict_1!="4"&verdict_1!="A"&verdict_1!="C"
gen tverdict_f = verdict_f 
replace tverdict_f = "" if verdict_f!="1"&verdict_f!="3"&verdict_f!="4"&verdict_f!="A"&verdict_f!="C"
gen verdict = tverdict_1 
replace verdict = tverdict_f if mi(tverdict_1) & !mi(tverdict_f)
label var verdict "Disposition Code" 
drop tverdict_1 tverdict_f

gen dispsample  = !mi(verdict)
gen dispsample1 = !mi(verdict_1) & numberdisp==1
label var dispsample "Valid Disposition Code"
label var dispsample1 "Valid Single Disposition Code"

gen contest = (verdict=="1"|verdict=="3"|verdict=="A")
label var contest "Contest"

gen efine = fine
replace efine = 0 if verdict=="3"
replace efine = 0.5*fine if verdict=="A"
label var efine "Effective Fine"

gen epoints = points
replace epoints = 0 if verdict=="3"|verdict=="A"|verdict=="C"
label var epoints "Effective Points"



********************************
//// STORE DATASET THUS FAR ////
********************************

qui compress
saveold "${temp}/TEMP", replace



*******************************************
//// ADD ON PAST AND FUTURE OFFENDING ////
*******************************************

egen double citationid = group(citationnumber countynum)
label var citationid "Numeric Citation ID"
order citationid
qui compress
saveold "${temp}/TEMP", replace

keep if dlvalid == 1
keep citationid dlnumber offensedate
joinby dlnumber using "${out}/1-offending"

gen py1  = (offensedate - date>1) & (offensedate - date<=365)
gen py2  = (offensedate - date>1) & (offensedate - date<=730)
gen py3  = (offensedate - date>1) & (offensedate - date<=1095)
gen py5  = (offensedate - date>1) & (offensedate - date<=1825)
gen py99 = (offensedate - date>1) & (offensedate - date<=36135)

gen ny1  = (date - offensedate>1) & (date - offensedate<=365)
gen ny2  = (date - offensedate>1) & (date - offensedate<=730)
gen ny3  = (date - offensedate>1) & (date - offensedate<=1095)
gen ny5  = (date - offensedate>1) & (date - offensedate<=1825)
gen ny99 = (date - offensedate>1) & (date - offensedate<=36135)


foreach o in py ny {
foreach t in 1 2 3 5 99 {

gen cite_`o'`t'  = (citation==1) & (`o'`t'==1) 
gen speed_`o'`t' = (citation==1) & (viol==575) & (`o'`t'==1)
gen other_`o'`t' = (citation==1) & (viol!=575) & (`o'`t'==1)
gen amove_`o'`t' = (citation==1) & (viol_class=="M") & (`o'`t'==1)
gen nmove_`o'`t' = (citation==1) & (viol_class!="M") & (`o'`t'==1)
gen crash_`o'`t'    = (crash==1) & (crash_form=="L"|mi(crash_form)) & (`o'`t'==1)
gen crashany_`o'`t' = (crash==1) & (`o'`t'==1)
gen crashinj_`o'`t' = (crash==1) & !mi(crash_severity) & (crash_severity>=2) & (`o'`t'==1)

}
}


collapse (max) *_py* *_ny*, by(citationid) fast
qui compress
saveold "${temp}/TEMP-OFFENDING", replace


use "${temp}/TEMP", clear
merge 1:1 citationid using "${temp}/TEMP-OFFENDING", keep(1 3) nogen
foreach x of varlist *_py* *_ny* {
replace `x' = 0 if mi(`x')
}



local py = "Past"
local ny = "Next"

foreach o in py ny {
foreach t in 1 2 3 5 99 {

label var cite_`o'`t' "Offense ``o'' `t' Year(s)"
label var speed_`o'`t' "Speeding ``o'' `t' Year(s)"
label var other_`o'`t' "Other ``o'' `t' Year(s)"
label var amove_`o'`t' "Moving ``o'' `t' Year(s)"
label var nmove_`o'`t' "Non-Moving ``o'' `t' Year(s)"
label var crash_`o'`t' "Crash ``o'' `t' Year(s)"
label var crashany_`o'`t' "Crash ``o'' `t' Year(s)"
label var crashinj_`o'`t' "Injury Crash ``o'' `t' Year(s)"

}
}

/// SAVE DATASET SO FAR ///
qui compress
saveold "${temp}/TEMP", replace





************************
/// BUILD PARTITIONS ///
************************


/// PARTITION 1: RANDOM ///
gen RANDOM = runiform()
bysort officerid: egen medRANDOM = median(RANDOM) 
gen partRANDOM = (RANDOM<=medRANDOM) + 1
label var partRANDOM "Partition (Random)" 
replace partRANDOM = . if mi(officerid)
drop RANDOM medRANDOM

qui compress
saveold "${temp}/TEMP", replace


/// PARTITION 2: LOCATION ///
use "${temp}/TEMP", clear
keep if !mi(officerid)
gen N = 1
collapse (sum) N, by(officerid countynum) 

bysort officerid: egen COUNT = sum(1)
keep if COUNT > 1

gen RANDOM = runiform()
bysort officerid (RANDOM): gen RANK = _n
bysort officerid: egen MEDRANK = median(RANK)
gen partCOUNTY = (RANK > MEDRANK)
label var partCOUNTY "Partition (Locations)" 

keep officerid countynum partCOUNTY
tempfile PART1 
save    `PART1'


/// PARTITION 3: LOCATION-TIME ///
use "${temp}/TEMP", clear
keep if !mi(officerid)
gen N = 1
collapse (sum) N, by(officerid year countynum) 

bysort officerid year: egen COUNT = sum(1)
keep if COUNT > 1

gen RANDOM = runiform()
bysort officerid year (RANDOM): gen RANK = _n
bysort officerid year: egen MEDRANK = median(RANK)
gen partCOUNTYYR = (RANK > MEDRANK)
label var partCOUNTYYR "Partition (Location-Time)" 

keep officerid year countynum partCOUNTYYR
tempfile PART2 
save    `PART2'


/// ATTACH PARTITIONS ///
use "${temp}/TEMP", clear
merge m:1 officerid countynum using `PART1', keep(1 3) nogen
merge m:1 officerid year countynum using `PART2', keep(1 3) nogen
replace partCOUNTY   = partCOUNTY + 1
replace partCOUNTYYR = partCOUNTYYR + 1

qui compress
saveold "${temp}/TEMP", replace



******************************
/// BINARY LENIENCE: TOTAL ///
******************************

* CUT TO SPEED + OFFICER SAMPLE *
keep if !mi(officerid) & (speedsample)==1

* FRANDSEN BINARY LENIENCE MEASURE *
gen temp = speeddiff==9 if speeddiff>=8 & speeddiff<=10
bysort officerid: egen P9 = mean(temp)
bysort officerid: egen N9 = total(speeddiff>=8 & speeddiff<=10)
gen     V9      = P9*(1-P9)/N9
gen     Z       = (P9 - 1.01/3.01)/sqrt(V9)
replace Z       = 0 if P9==0
replace Z       = 0 if P9==.
replace Z       = 10 if P9==1
gen     lenient = Z>2.576
drop temp P9 N9 V9 Z

* REPLACE TO MISSING WITHOUT SUFFICIENT STOPS *
bysort officerid: egen sumstops = sum(1)
replace lenient = . if sumstops<50

* STORE LENIENCE *
keep officerid lenient
duplicates drop
qui compress
tempfile TEMP
save    `TEMP'

* MERGE BACK ONTO DATA *
use "${temp}/TEMP", clear
merge m:1 officerid using `TEMP', keep(1 3) nogen
order citationnumber-officerid lenient
label var lenient "Lenient Officer"

* SAVE AGAIN *
qui compress
saveold "${temp}/TEMP", replace



**************************************
//// BINARY LENIENCE: PARTITIONS ////
**************************************

* CUT TO SPEED + OFFICER SAMPLE *
keep if !mi(officerid) & (speedsample)==1
drop lenient 

* FRANDSEN BINARY LENIENCE MEASURE *
gen temp = speeddiff==9 if speeddiff>=8 & speeddiff<=10
bysort officerid partRANDOM: egen P9 = mean(temp)
bysort officerid partRANDOM: egen N9 = total(speeddiff>=8 & speeddiff<=10)
gen     V9      = P9*(1-P9)/N9
gen     Z       = (P9 - 1.01/3.01)/sqrt(V9)
replace Z       = 0 if P9==0
replace Z       = 0 if P9==.
replace Z       = 10 if P9==1
gen     lenient = Z>2.576
drop temp P9 N9 V9 Z

* REPLACE TO MISSING WITHOUT SUFFICIENT STOPS *
bysort officerid partRANDOM: egen sumstops = sum(1)
replace lenient = . if sumstops<25

* STORE LENIENCE IN CURRENT PARTITION *
keep officerid partRANDOM lenient
ren lenient lenientpartreal 
label var lenientpartreal "Lenient (in partition)" 
duplicates drop
tempfile TEMP1 
save    `TEMP1'

* STORE LENIENCE IN OTHER PART * 
ren partRANDOM part 
gen partRANDOM = . 
replace partRANDOM = 1 if part == 2 
replace partRANDOM = 2 if part == 1
ren lenientpartreal lenientpart 
label var lenientpart "Lenient (in other partition)" 
keep officerid partRANDOM lenientpart 
tempfile TEMP2 
save    `TEMP2'


* MERGE BACK ONTO DATA * 
use "${temp}/TEMP", clear
merge m:1 officerid partRANDOM using `TEMP1', keep(1 3) nogen
merge m:1 officerid partRANDOM using `TEMP2', keep(1 3) nogen
order citationnumber-officerid lenient lenientpartreal lenientpart partRANDOM partCOUNTY partCOUNTYYR
qui compress
saveold "${temp}/TEMP", replace



******************************
/// PREDICTED REOFFENDING ///
******************************

#delimit ;
global COV = "female age agesq age_miss race_b race_h race_o race_u 
priorprison local logzip zipincome_miss logprice veh_miss 
speed_py1 other_py1 crashany_py1" ;
#delimit cr

local cite = "Offense"
local speed = "Speeding" 
local crashany = "Crash"
local contest = "Contest"
gen contest_ny1 = contest

foreach y in cite speed crashany contest {

reg `y'_ny1 $COV if partRANDOM==1 & lenientpartreal==1 & speedsample==1 & instate==1 & speeddiff>=9
predict hat_1 

reg `y'_ny1 $COV if partRANDOM==1 & lenientpartreal==1 & speedsample==1 & instate==1 & speeddiff>=9
predict hat_2 

gen hatho_`y' = .
replace hatho_`y' = hat_1 if partRANDOM == 2
replace hatho_`y' = hat_2 if partRANDOM == 1
label var hatho_`y' "Predicted ``y'' (Lenient, Other Partition)"

drop hat_1 hat_2 

}

drop contest_ny1 




*****************************
//// STORE FINAL DATASET ////
*****************************

order citationid citationnumber-officerid 
order citationid-rtlength numberdisp dispsample dispsample1 verdict_1 verdict_final verdict contest efine epoints
order citationid-epoints partRANDOM partCOUNTY partCOUNTYYR hatho_cite hatho_speed hatho_crashany hatho_contest
qui compress
label data "All FHP Stops"
saveold "${out}/2-stopsfhp", replace


* DELETE TEMP FILES *
rm "${temp}/TEMP.dta"
rm "${temp}/TEMP-COMPANION.dta"
rm "${temp}/TEMP-COURT-1.dta"
rm "${temp}/TEMP-COURT-2.dta"
rm "${temp}/TEMP-COURT-3.dta"
* rm "${temp}/TEMP-LENIENT.dta"
rm "${temp}/TEMP-OFFENDING.dta"
* rm "${temp}/TEMP-LENIENTPART.dta"











